package com.baiyue.mapper;

import com.baiyue.entity.ProductInfo;
import com.baiyue.entity.TollRules;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 伍波
 * @date 2024-06-13
 */
@Mapper
public interface ProductInfoMapper extends BaseMapper<ProductInfo> {
    /**
     * 分页查询 商品信息
     * @param productInfo
     * @return
     */
    List<ProductInfo> findByPage(ProductInfo productInfo, Pagination page);

    @Select({
            "select",
            "*",
            "from product_info",
            "where product_name = #{productName}  and status != 1"
    })
    ProductInfo findByProductName(String productName);

    Integer deleteByIds(Map<String,Object> paramMap);

    /**
     * 不分页查询 商品信息
     * @param productInfo
     * @return
     */
    List<ProductInfo> findByPage(ProductInfo productInfo);
}
